package com.study.service;

import com.study.injection.UserDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author chenyeqing
 * @Date 2021/10/31 17:56
 */
@Service
public class UserServiceImpl implements UserService {

    // @Resource(name = "userDAOImpl")
    private UserDAO userDAO;

    // @Autowired
    // @Qualifier("userDAOImpl")
    public void setUserDAO(UserDAO userDAO) {
        System.out.println("调用了set方法");
        this.userDAO = userDAO;
    }

    @Override
    public void save() {
        userDAO.save();
    }
}
